<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="/util/dist/bootstrap.css">
    <link href="/util/dist/summernote.css" rel="stylesheet">
    <script src="/util/js/jquery.min.js"></script>
    <script src="/util/js/bootstrap.min.js"></script>
    <script src="/util/dist/summernote.js"></script>
    <script src="/util/dist/lang/summernote-zh-CN.js"></script>
    <script src="../js/ajax.js"></script>
</head>
<style>
    .summernote {
        width: 600px;
        height: 400px;
        margin: auto;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .summernote input[type=button] {
        width: 200px;
        height: 30px;
        background-color: #5bc0de;
    }
</style>

<script>
    $(function () {
        getCompany();
    });

    function getCompany() {
        var data = myAjax("company", "", "get");
        $('.rich-text').summernote("code", data[0].content);
        $('.rich-text').summernote({
            height: 400,
            tabsize: 2,
            lang: 'zh-CN'
        });
    }

    function saveCompany() {
        var content = $('.rich-text').summernote("code");
        var data = myAjax("saveCompany", {content: content}, "get");
        alert(data)
    }
</script>
<body>
<div class="summernote">
    <div class="rich-text"></div>
    <div><input type="button" value="保存" onclick="saveCompany()"></div>
</div>
</body>
</html>